var pattern = /^123\|$/;
var value = pattern.test('123|');
console.log(value);

var pattern = /^123/;
var value = pattern.test('212333333');
console.log(value);

var pattern = /^123{1,2}$/;
var value = pattern.test('123333333');
console.log(value);

var str = '123123';
var pattern1 = /123/g;
console.log(str.replace(pattern1,'search'));


var pattern = /[1-9][0-9]{4,10}/;
value = pattern.test(112312313131);
console.log(value);
var value = pattern.test(025-812654567);
console.log(value);

var pattern = /#[1-9a-zA-Z~-]{6}|#[1-9a-zA-Z~-]{3}/;


